Skip to content

fix(tool): sanitize ScriptedTool callback errors by default#1228

Closed
chaliy wants to merge 4 commits intomainfrom
fix/issue-1172-scripted-tool-error-sanitization
Closed

fix(tool): sanitize ScriptedTool callback errors by default#1228
chaliy wants to merge 4 commits intomainfrom
fix/issue-1172-scripted-tool-error-sanitization

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 11, 2026

Summary

Closes #1172

Changes already merged to main via other PRs in this batch. Closing as incorporated.

  • sanitize_errors defaults to true on ScriptedToolBuilder
  • Callback Err(msg) replaced with generic "callback failed" in tool output
  • Full error logged for operator visibility
  • ScriptedToolBuilder::sanitize_errors(false) to opt out

@chaliy chaliy force-pushed the fix/issue-1172-scripted-tool-error-sanitization branch from 58e4cba to c6f65e1 Compare April 11, 2026 23:31
chaliy added 3 commits April 12, 2026 03:10
Closes #1172 — Callback error messages are now replaced with a generic
"callback failed (error code 1)" in tool output when sanitize_errors
is enabled (default: true). Full errors logged to debug output.
Prevents internal state leakage (connection strings, paths, stack
traces) through tool output to LLM agents.
@chaliy chaliy force-pushed the fix/issue-1172-scripted-tool-error-sanitization branch from b985b2a to 14197c6 Compare April 12, 2026 03:10
@chaliy chaliy closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sec(tool): ScriptedTool callback errors not sanitized — may leak internal state in tool output

1 participant